package com.zzedu.web.controller;

import com.zzedu.annon.AccessPermission;
import com.zzedu.common.annotation.Log;
import com.zzedu.common.enums.BusinessType;
import com.zzedu.common.enums.OperatorType;
import com.zzedu.common.enums.UserTypeEnumns;
import com.zzedu.common.utils.SecurityUtils;
import com.zzedu.manager.IZzStuClassesManager;
import com.zzedu.result.Result;
import com.zzedu.stu.rsp.ApiZzClassesInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 学生班级
 */
@RestController
@RequestMapping("stuClazz")
@AccessPermission(value = {UserTypeEnumns.STUDENT})
public class StuClazzController {

    @Autowired
    IZzStuClassesManager zzStuClassesManager;

    /**
     * 当前学生班级列表
     *
     * @return
     */
    @PostMapping(value = {"/stuClassList"}, produces = {MediaType.APPLICATION_JSON_VALUE}, consumes = {MediaType.APPLICATION_JSON_VALUE})
    @Log(title = "登录学生班级列表", businessType = BusinessType.APP_STUDENT, operatorType = OperatorType.MOBILE)
    public Result<List<ApiZzClassesInfoVO>> stuClassList() {
        return zzStuClassesManager.getLoginClassList(SecurityUtils.getLoginUser());
    }
}
